xlv.obj.tabPane={
	extend:function(){
	},
	implement:function(){
	},
	create:function(tag){
		var div=document.createElement((tag||'div'));
		div.setAttribute('xlvobject','xlv.obj.tabPane');
		Element.addClassName(div,'class_tabPane');
		return div;
	},
	properties:{
		tabProperties:null,
		tabMethod:null,
		layerProperties:null,
		layerMethod:null
	},
	method:{
		construct:function(){
			Element.addClassName(this,'class_tabPane');
			var p=this.$P;
			var v=this.$V;
			v.tab=xlv.util.findDirectChild(this,{xlvobject:'xlv.obj.tab'},false,false);
			if(!v.tab)this.appendChild(v.tab=xlv.sys.newObject('tab',p.tabProperties,p.tabMethod));
			v.layerPanes=xlv.util.findDirectChild(this,{xlvobject:'xlv.obj.layerPanes'},false,false);
			if(!v.layerPanes)this.appendChild(v.layerPanes=xlv.sys.newObject('layerPanes',p.layerProperties,p.layerMethod));
			this.styleForTab(v.tab);
			this.styleForLayerPanes(v.layerPanes);
		},
		initial:function(){
			this.addEventHandler('xlv:select_changed','_xlv_select_changed');
			this.addEventHandler('xlv:active_changed','_xlv_active_changed');
		},
		styleForTab:function(tab){
		},
		styleForLayerPanes:function(layerpanes){
		},
		getTab:function(){
			return this.$V.tab;
		},
		getLayerPanes:function(){
			return this.$V.layerPanes;
		},
		getSelectedIndex:function(){
			return this.$V.tab.getSelectedIndex();
		},
		_xlv_select_changed:function(event){
			var target=event.target;
			if(this.$V.tab==target){
				event.stop();
				var tab_index=this.$V.tab.getSelectedIndex();
				var pane_index=this.$V.layerPanes.getActivatedIndex();
				if(tab_index!=pane_index){
					this.$V.layerPanes.activePane(tab_index);
					var memo=event.memo;
					setTimeout(function(){this.fire('xlv:select_changed',memo);}.bind(this),1);
				}
			}
		},
		_xlv_active_changed:function(event){
			event.stop();
		}
	}
};
